package com.lyh.system.service.impl;

import java.math.BigDecimal;
import java.util.List;

import com.lyh.common.core.domain.AjaxResult;
import com.lyh.common.utils.DateUtils;
import com.lyh.system.domain.Asset;
import com.lyh.system.service.IAssetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lyh.system.mapper.AssetEvidenceMapper;
import com.lyh.system.domain.AssetEvidence;
import com.lyh.system.service.IAssetEvidenceService;

/**
 * 资产通证Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-27
 */
@Service
public class AssetEvidenceServiceImpl implements IAssetEvidenceService {
    @Autowired
    private AssetEvidenceMapper assetEvidenceMapper;

    @Autowired
    private IAssetService assetService;

    /**
     * 查询资产通证
     *
     * @param id 资产通证主键
     * @return 资产通证
     */
    @Override
    public AssetEvidence selectAssetEvidenceById(Long id) {
        return assetEvidenceMapper.selectAssetEvidenceById(id);
    }

    /**
     * 查询资产通证列表
     *
     * @param assetEvidence 资产通证
     * @return 资产通证
     */
    @Override
    public List<AssetEvidence> selectAssetEvidenceList(AssetEvidence assetEvidence) {
        return assetEvidenceMapper.selectAssetEvidenceList(assetEvidence);
    }

    /**
     * 新增资产通证
     *
     * @param assetEvidence 资产通证
     * @return 结果
     */
    @Override
    public int insertAssetEvidence(AssetEvidence assetEvidence) {
        assetEvidence.setCreateTime(DateUtils.getNowDate());
        return assetEvidenceMapper.insertAssetEvidence(assetEvidence);
    }

    /**
     * 修改资产通证
     *
     * @param assetEvidence 资产通证
     * @return 结果
     */
    @Override
    public int updateAssetEvidence(AssetEvidence assetEvidence) {
        assetEvidence.setUpdateTime(DateUtils.getNowDate());
        return assetEvidenceMapper.updateAssetEvidence(assetEvidence);
    }

    /**
     * 批量删除资产通证
     *
     * @param ids 需要删除的资产通证主键
     * @return 结果
     */
    @Override
    public int deleteAssetEvidenceByIds(Long[] ids) {
        return assetEvidenceMapper.deleteAssetEvidenceByIds(ids);
    }

    /**
     * 删除资产通证信息
     *
     * @param id 资产通证主键
     * @return 结果
     */
    @Override
    public int deleteAssetEvidenceById(Long id) {
        return assetEvidenceMapper.deleteAssetEvidenceById(id);
    }
}
